package com.mxin.image

import android.graphics.drawable.Drawable
import android.widget.ImageView
import com.mxin.image.glide.GlideApp
import com.mxin.image.glide.GlideRequest

fun <T> ImageView.load(o:Any?, block:(GlideRequest<Drawable>)->GlideRequest<T>){
    GlideApp.with(this).load(o).let {
        block(it)
    }.into(this)
}

fun ImageView.load(o:Any?, placeholderRes:Int){
    load(o){ it.placeholder(placeholderRes) }
}